<html>
<head>
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Off Canvas Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="assets/css/offcanvas.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]>
    <script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="assets/js/ie-emulation-modes-warning.js"></script>
</head>
<body>
<nav class="navbar navbar-fixed-top navbar-inverse">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
     
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
            <li><a href="index.php?c=index&m=index">首页</a></li>
            <li><a href="index.php?c=index&m=listall&tid=1">川菜</a></li>
            <li><a href="index.php?c=index&m=listall&tid=2">徽菜</a></li>
            <li><a href="index.php?c=index&m=listall&tid=3">鲁菜</a></li>
            <li><a href="index.php?c=index&m=listall&tid=4">闽菜</a></li>
            <li><a href="index.php?c=index&m=listall&tid=5">苏菜</a></li>
            <li><a href="index.php?c=index&m=listall&tid=6">湘菜</a></li>
            <li><a href="index.php?c=index&m=listall&tid=7">粤菜</a></li>
            <li><a href="index.php?c=index&m=listall&tid=8">浙菜</a></li>
        </ul>

        <ul class="nav navbar-nav navbar-right">
              <?php session_start(); 
              if(isset($_SESSION["uname"])){ ?>
              <li><a href="index.php?c=index&m=logout">注销</a></li>
              <li><a href="index.php?c=index&m=reguser">注册</a></li>
              <li class="active"><a href="#" >欢迎 
              
                 <?php echo " ".$_SESSION["uname"]." ";}
                else {?> 
              <li role="presentation"><a href="index.php?c=index&m=login">登陆</a></li>
              <li role="presentation"><a href="index.php?c=index&m=reguser">注册</a></li>
              <li role="presentation"><a href="admin/login.html">管理员登陆</a></li>
              <li class="active"><a href="#" >欢迎  
                <?php echo "您";}
                 ?>访问本站</a></li>
        </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

<div class="container">

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
    <ol class="carousel-indicators">
        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
        <li data-target="#carousel-example-generic" data-slide-to="2"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner">
        <div class="item active">
            <img src="assets/images/1.jpg" class="img-responsive" style="width:100%" alt="东坡肉">
        </div>
        <div class="item">
            <img src="assets/images/2.jpg" class="img-responsive" style="width:100%" alt="葱烧海参">     
        </div>
        <div class="item">
            <img src="assets/images/3.jpg" class="img-responsive" style="width:100%" alt="避风塘炒虾">
        </div>
    </div>

    <!-- Controls -->
    <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
</div>
<!--幻灯片结束-->
</div>  
<div class="row row-offcanvas row-offcanvas-right">
    <div class="col-xs-12 col-sm-9">
        <div class="row text-center">
            <div class="col-xs-12 col-lg-12 mlist">
            <h2>川菜</h2>
            <?php 
                $row=$data['foods'];
                foreach ($data['foods'] as $row) {
                  if ($row['tid']==1) {
           ?>
            <ul class="list-inline row text-center">
            <li class="col-xs-4 col-sm-3 col-lg-2">
            <img src="upload/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php echo $row["foodname"];?></a></p>
            </li>
            <?php  }} ?>
            </ul>
            <p><a href="index.php?c=index&m=listall&tid=3">更多</a></p>
            </div>
        </div>

        <div class="row text-center">
            <div class="col-xs-12 col-lg-12 mlist">
            <h2>徽菜</h2>
            <?php 
                $row=$data['foods'];
                foreach ($data['foods'] as $row) {
                  if ($row['tid']==2) {
           ?>
            <ul class="list-inline row text-center">
            <li class="col-xs-4 col-sm-3 col-lg-2">
            <img src="upload/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php echo $row["foodname"];?></a></p>
            </li>
            <?php  }} ?>
            </ul>
            <p><a href="index.php?c=index&m=listall&tid=2">更多</a></p>
            </div>
        </div>
        

        <div class="row text-center">
            <div class="col-xs-12 col-lg-12 mlist">
            <h2>鲁菜</h2>
            <?php 
                $row=$data['foods'];
                foreach ($data['foods'] as $row) {
                  if ($row['tid']==3) {
           ?>
            <ul class="list-inline row text-center">
            <li class="col-xs-4 col-sm-3 col-lg-2">
            <img src="upload/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php echo $row["foodname"];?></a></p>
            </li>
            <?php  }} ?>
            </ul>
            <p><a href="index.php?c=index&m=listall&tid=5">更多</a></p>
            </div>
        </div>
         <div class="row text-center">
            <div class="col-xs-12 col-lg-12 mlist">
            <h2>闽菜</h2>
            <?php 
                $row=$data['foods'];
                foreach ($data['foods'] as $row) {
                  if ($row['tid']==4) {
           ?>
            <ul class="list-inline row text-center">
            <li class="col-xs-4 col-sm-3 col-lg-2">
            <img src="upload/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php echo $row["foodname"];?></a></p>
            </li>
            <?php  }} ?>
            </ul>
            <p><a href="index.php?c=index&m=listall&tid=5">更多</a></p>
            </div>
        </div>
                <div class="row text-center">
            <div class="col-xs-12 col-lg-12 mlist">
            <h2>苏菜</h2>
            <?php 
                $row=$data['foods'];
                foreach ($data['foods'] as $row) {
                  if ($row['tid']==5) {
           ?>
            <ul class="list-inline row text-center">
            <li class="col-xs-4 col-sm-3 col-lg-2">
            <img src="upload/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php echo $row["foodname"];?></a></p>
            </li>
            <?php  }} ?>
            </ul>
            <p><a href="index.php?c=index&m=listall&tid=5">更多</a></p>
            </div>
        </div>
                <div class="row text-center">
            <div class="col-xs-12 col-lg-12 mlist">
            <h2>湘菜</h2>
            <?php 
                $row=$data['foods'];
                foreach ($data['foods'] as $row) {
                  if ($row['tid']==6) {
           ?>
            <ul class="list-inline row text-center">
            <li class="col-xs-4 col-sm-3 col-lg-2">
            <img src="upload/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php echo $row["foodname"];?></a></p>
            </li>
            <?php  }} ?>
            </ul>
            <p><a href="index.php?c=index&m=listall&tid=5">更多</a></p>
            </div>
        </div>
                <div class="row text-center">
            <div class="col-xs-12 col-lg-12 mlist">
            <h2>粤菜</h2>
            <?php 
                $row=$data['foods'];
                foreach ($data['foods'] as $row) {
                  if ($row['tid']==7) {
           ?>
            <ul class="list-inline row text-center">
            <li class="col-xs-4 col-sm-3 col-lg-2">
            <img src="upload/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php echo $row["foodname"];?></a></p>
            </li>
            <?php  }} ?>
            </ul>
            <p><a href="index.php?c=index&m=listall&tid=5">更多</a></p>
            </div>
        </div>










      </div>

      <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
          <div class="list-group text-center">
              <h2 style="color:white;" >点击排行</h2>
              <ul class="list-inline row text-center">
                    <?php
                    foreach ($data['foods'] as $row)
                    {
                        ?>
                        <li class="col-xs-12 col-lg-6">
                            <img src="upload/<?php
                            echo $row["pic"];
                            ?>" class="responsive img-thumbnail" />
                            <p><a href="index.php?c=index&m=content&vid=<?php echo $row['vid']; ?>"><?php
//显示美食名称中的前 5个字符
                                echo mb_substr($row["foodname"],0,6,'utf-8');
                                ?></a>
                            </p>
                        </li>                
                        <?php
                    }
                    ?>
                </ul>
          </div>
      </div>

        <!-- <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar"> 
            <div class="list-group text-center">
                <h2 style="color:white;" >下载排行</h2>
                <ul class="list-inline row text-center">
                    <?php
                    //foreach ($data['foods'] as $row)
                    {
                        ?>
                        <li class="col-xs-12 col-lg-6">
                            <img src="upload/<?php
                            //echo $row["pic"];
                            ?>" class="responsive img-thumbnail" />
                           //<p><a href="index.php?c=index&m=content&vid=<?php //echo $row['vid']; ?>"><?php
//显示美食名称中的前 5个字符
                               // echo mb_substr($row["foodname"],0,6,'utf-8');
                                ?></a>
                            </p>
                        </li>
                        <?php
                    }
                    ?>
                </ul>
          </div>
        </div> -->

      </div>

  </div>
  <script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>

<script src="offcanvas.js"></script>
<script>
    $('.carousel').carousel({
        interval: 3000 //changes the speed
    })
</script>
</body>
</html>